home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-19 / iritsm3s.zip / CONTOURS.IRT < prev    next >
Text File  |  1991-11-29  |  1KB  |  51 lines

  1. #
  2. # Intersection of cone and a cylinder:
  3. # Try this one with resolution equal 20 - slower, but much nicer!
  4. #
  5. #            Created by Gershon Elber,    Jan. 89
  6. #
  7.  
  8. save_mat = view_mat;
  9. view_mat = view_mat * scale(vector(0.2, 0.2, 0.2));
  10. save_res = resolution;
  11. resolution = 8;
  12.  
  13. cone1 = con2(vector(0,0,-1),vector(0,0,4),2,1);
  14. cylin1= cylin(vector(0,3,0),vector(0,-6,2),0.7);
  15.  
  16. a = cone1+cylin1;
  17. free(cylin1);
  18. free(cone1);
  19. beep(500,300);
  20. interact(list(a), false);
  21.  
  22. intercrv = true;
  23. #
  24. # Currently variables can not be introduced in a loop (except the iteration
  25. # vairable), so we prepare all variables in advance.
  26. #
  27. p = circpoly(vector(0.0, 0.0, 1.0), vector( 0.0, 0.0, -0.9), 6.0);
  28. c = cntrs = a * p;
  29. view(list(cntrs), false);
  30. for ( (i = -0.7), 0.2, 2.9,
  31.         (
  32.           (p = circpoly(vector(0.0, 0.0, 1.0), vector( 0.0, 0.0, i), 6.0)):
  33.       (c = a * p):
  34.       view(list(c), false):
  35.       (cntrs = cntrs + c)
  36.         )
  37.     );
  38. intercrv = false;
  39.  
  40. save("contours", list(view_mat,cntrs));
  41. free(a);
  42. free(p);
  43. free(c);
  44. free(cntrs);
  45.  
  46. resolution = save_res;
  47. view_mat = save_mat;
  48.  
  49.  
  50.  
  51.